package com.smallchill.common.dao;

import org.beetl.sql.core.ClasspathLoader;
import org.beetl.sql.core.ConnectionSource;
import org.beetl.sql.core.DefaultNameConversion;
import org.beetl.sql.core.Interceptor;
import org.beetl.sql.core.SQLLoader;
import org.beetl.sql.core.SQLManager;
import org.beetl.sql.core.db.DBStyle;
import org.beetl.sql.core.db.OracleStyle;

import com.smallchill.core.support.ReportInterceptor;

public class DaoMaker {

	public static SQLManager makeSqlManager() {
		ConnectionSource cs = new DataBaseConnection();
		DBStyle style = new OracleStyle();
		SQLLoader loader = new ClasspathLoader("/beetlsql");
		SQLManager sql = new SQLManager(style, loader, cs, new DefaultNameConversion(), new Interceptor[] { new ReportInterceptor() });
		sql.getSqlLoader().setCharset("utf-8");
		return sql;
	}
	
}
